package gamemngr;


import java.io.File;
import java.io.InputStream;
import java.io.Serializable;
import java.util.Scanner;

public class HelpMenu implements Serializable {

	private static final long serialVersionUID = 1L;
	private InputStream helpFileStream;

	public HelpMenu(String path){
		this.helpFileStream = resources.Configuration.getHelpStream(path);
	}

	public HelpMenu(File file) {
		this(file.getName());
	}

	/**
	 * print the help menu 
	 */
	public void printHelp(){
		System.out.println(this);
	}

	public String toString(){
		String helpText = "";
		Scanner scanner =  new Scanner(this.helpFileStream);
		while (scanner.hasNextLine()){
			helpText += scanner.nextLine() + "\n";
		}
		return helpText;
	}
}
